package com.zyf.pattern.delegate.leader;

import java.util.HashMap;
import java.util.Map;

/**
 * create by yifeng
 */
public class Leader implements ITarget{

    private Map<String, ITarget> targets = new HashMap<>();

    public Leader() {
        targets.put("加密", new TargetA());
        targets.put("登录", new TargetB());
    }

    // 项目经理自己不干活，分配给被人干活
    @Override
    public void doing(String commond) {
        targets.get(commond).doing(commond);
    }
}
